package cc.md888.app.web.controller;


import cc.md888.app.application.account.FacebookAccountService;
import cc.md888.app.model.account.AccountAuthVO;
import cc.md888.result.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "Facebook账号")
@RestController
@RequestMapping("/api/facebook")
public class FacebookAccountController {

    @Autowired
    private FacebookAccountService facebookAccountService;

    /**
     * 获取账号认证信息
     * @param token
     * @return
     */
    @GetMapping("/getAccountAuthInfo")
    public Result<AccountAuthVO> getAccountAuth(@RequestParam("token") String token) {
        return Result.ok(
                facebookAccountService.getAccountAuthInfo(token)
        );
    }
}
